<%@page import="java.util.List"%>
<%@ include file="/inc/header.jsp" %>
<html:form action="/category">
  <table border="0" align="center" cellspacing="0" cellpadding="0" width="75%">
    <tr>
      <th class="colored" colspan="4"><b>Ajout d'une cat&eacute;gorie</b></th>
    </tr>
    <tr>
      <td width="5%" align="center" valign="top">&nbsp;</td>
      <td align="left" valign="top">&nbsp;</td>
      <td align="left" valign="top">&nbsp;</td>
      <td width="36%" align="center" valign="top">&nbsp;</td>
    </tr>
    <tr>
      <td width="5%" align="center" valign="top">&nbsp;</td>
      <td align="left" valign="top">Nom :&nbsp;</td>
      <td align="left" valign="top"><html:text property="name" /></td>
      <td width="36%" align="center" valign="top">&nbsp;</td>
    </tr>
    <tr>
      <td align="left" valign="top" colspan="4">&nbsp;</td>
    </tr>
    <tr>
      <td width="5%" align="center" valign="top">&nbsp;</td>
      <td align="left" valign="top">Dans la cat&eacute;gorie :</td>
      <td width="36%" align="left" valign="top">
      <logic:present name="categorylist">
      	<%
      		int size = ((List) request.getAttribute("categorylist")).size();
      		int count = (size+2) / 2;
      		String countStr = String.valueOf(count);
      	%>
      	<logic:iterate id="categoryForm" indexId="i" name="categorylist">
			<logic:equal name="i" value="<%= countStr %>">
			  </td>
		      <td width="36%" align="left" valign="top">
			</logic:equal>
			<html:radio idName="categoryForm" property="parentId" value="id" />&nbsp;
			<bean:write name="categoryForm" property="fullname" /><br>
		</logic:iterate>
		<html:radio property="parentId" value="-1" /> Aucune
	  </logic:present>
      </td>
    </tr>
    <tr>
      <td align="left" valign="top" colspan="4">&nbsp;</td>
    </tr>
    <tr>
      <td colspan="4" align="center" valign="top">
      	<html:submit property="actionName" value="Ajouter" styleClass="button" />
        &nbsp; <html:button property="foo" value="Annuler" onclick="history.back()" styleClass="button"/>
      </td>
    </tr>
  </table>
</html:form>
<script language="JavaScript">
<!--
	document.forms[0].name.focus();
//-->
</script>

<%@ include file="/inc/footer.jsp" %>
